﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
    public interface IAlternateHypothesisManager
    {
        /// <summary>
        /// Collects adds alternate predecessors for a token that would have lost because of viterbi.
        /// </summary>
        /// <param name="token">a token that has an alternate lower scoring predecessor that still might be of interest</param>
        /// <param name="predecessor">a predecessor that scores lower than token.getPredecessor().</param>
        void addAlternatePredecessor(IToken token, IToken predecessor);
        /// <summary>
        /// Returns a list of alternate predecessors for a token.
        /// </summary>
        /// <param name="token">a token that may have alternate lower scoring predecessor that still might be of interest</param>
        /// <returns>A list of predecessors that scores lower than token.getPredecessor().</returns>
        List<IToken> getAlternatePredecessors(IToken token);

        /// <summary>
        /// Purge all but max number of alternate preceding token hypotheses. 
        /// </summary>
        void purge();
        /// <summary>
        /// Change the successor from one token to another
        /// </summary>
        /// <param name="newSuccessor">the new successor token</param>
        /// <param name="oldSuccessor">the old successor token</param>
        void changeSuccessor(IToken newSuccessor, IToken oldSuccessor);


        Boolean hasAlternatePredecessors(IToken token);
    }
}
